<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="/struts-tags" prefix="s" %>  
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-3.2.0.js">
</script>
<script >	
	
$(function(){
	$("#username").val("${session.loginUser.username}");
	$("#phone").val("${session.loginUser.phone}");
	$("#email").val("${session.loginUser.email}");
	$("#password").val("${session.loginUser.password}");
	alert(username);
	alert(phone);
	alert(email);
	alert(password);
});
var regeditError='${regeditError}';
if(regeditError=="修改成功"){
    alert(regeditError);
    regeditError="";
    }
	 function check(){
/* 		var username = $("#username").val();
 */		var password = document.getElementById("password").value;
		var phone = document.getElementById("phone").value;
		
		/* if(username == null || username == ""){
			alert("用户名不能为空");
			return false;
		} */
		if(password == null || password == ""){
			alert("密码不能为空");
			return false;
		}	
 		 if(!/^[0-9]*$/.test(phone) || phone.length != 11){  
			alert("请输入有效的电话号码");
			return false;
		} 
		return true;
	} 
</script>
<link href="css/footer.css" type="text/css" rel="stylesheet"/>
</head>
<body>
	
	<div align="right" style="margin-right: 350px">
		<h2 align="center" style="margin-right: 350px">个人信息修改</h2>
		<form action="userAction" method="post"  onsubmit="return check()">
			<div align="right" style="margin-right: 200px">
<!-- 				<font color="red">*</font>用户名：<input style="margin-right: 231px" type="text" name="username" id="username"  /><br><br>
 -->				电话号码：<input maxlength="11"  style="margin-right: 231px" type="text" name="phone" id="phone"  /><br><br>
				邮箱：<input style="margin-right: 231px" type="text" name="email" id="email"  /><br><br>
				<font color="red">*</font>修改密码：<input style="margin-right: 231px" type="password" name="password" id="password" />
				
				<input type="hidden" id="id" name="id" value="${session.loginUser.id}"/>
			</div>
			<div style="margin-right: 50px" align="right">
				<input  style="margin-right: 50px;aligh:right" type="submit"  value="提交" />
			</div>
		</form>
	</div>
	<script>
	
    

/* function check(){

	var username = document.getElementById("username").value;
	var password = document.getElementById("password").value;
	var phone = document.getElementById("phone").value;
	var email = document.getElementById("email").value;
	
	if(username == null || username == ""){
		alert("用户名不能为空");
		return false;
	}
	if(password == null || password == ""){
		alert("密码不能为空");
		return false;
	}
	return true;
} */

</script>
</body>
</html>